<?php require_once('../Connections/CSRE_Connection.php'); ?>

<?php include('userValidation.php'); ?>

<?php require_once('functions.php'); ?>

<?php

if ((isset($_GET['id_banner'])) && ($_GET['id_banner'] != "")) {
  $deleteSQL = sprintf("DELETE FROM csre_banner WHERE id_banner=%s",
                       GetSQLValueString($_GET['id_banner'], "int"));

  mysql_select_db($database_CSRE_Connection, $CSRE_Connection);
  $Result1 = mysql_query($deleteSQL, $CSRE_Connection) or die(mysql_error());

  $deleteGoTo = "banner_editor.php";
  if (isset($_SERVER['QUERY_STRING'])) {
    $deleteGoTo .= (strpos($deleteGoTo, '?')) ? "&" : "?";
    $deleteGoTo .= $_SERVER['QUERY_STRING'];
  }
  header(sprintf("Location: %s", $deleteGoTo));
}
?>